<template>
  <div class="app-container">
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span>分类管理</span>
          <el-button type="primary">添加分类</el-button>
        </div>
      </template>
      
      <el-table :data="tableData" style="width: 100%; margin-bottom: 100px;">
        <el-table-column prop="id" label="ID" width="80" />
        <el-table-column prop="name" label="分类名称" />
        <el-table-column prop="description" label="描述" />
        <el-table-column prop="createTime" label="创建时间" />
        <el-table-column label="操作" width="200">
          <template #default="scope">
            <el-button size="small">编辑</el-button>
            <el-button size="small" type="danger">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const tableData = ref([
  {
    id: 1,
    name: '川菜',
    description: '四川风味菜肴',
    createTime: '2023-01-01'
  },
  {
    id: 2,
    name: '粤菜',
    description: '广东风味菜肴',
    createTime: '2023-01-02'
  },
  {
    id: 3,
    name: '湘菜',
    description: '湖南风味菜肴',
    createTime: '2023-01-03'
  }
])
</script>

<style lang="less" scoped>
.app-container {
  .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}
.box-card{
  border-radius: 10px;
}
</style>